﻿using Autofac;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace 人员管理
{
    internal class AutofacBuilder
    {
        public static IContainer _container;

        public static void init()
        {
            var builder = new ContainerBuilder();


            //注册当前程序集的所有类成员
            builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly())
                .AsImplementedInterfaces().AsSelf();


            _container = builder.Build();
        }
    }
}
